import req from '../utils/request'
import * as URL from '../constans/api'
export function getArticles(params) {
    return req({
        url: URL.GET_ARTICLE,
        method: 'get',
        params:{
            ...params
        }
        })
        .then(res => res.data.data)
        .catch(err => err)
}
//编辑文章列表
export function editArticles() {
    return req({
        url: URL.PUT_ARTICLE,
        method: 'get',
    })
        .then(res => res.data.data)
        .catch(err => err)
}
// 删除文章
export function getArticleDetail(id) {
    return req({
        url: URL.DELETE_ARTICLE + id,
        method: 'delete',
    })
        .then(res => res.data.data)
        .catch(err => err)
}
//发布文章
export function postArticle(params) {
    return req({
        url: URL.POST_ARTICLE,
        method: 'post',
        data: {
            ...params
        }
    })
        .then(res => res.data.data)
        .catch(err => err)
}
